{% extends "base.html" %} {% block title %}管理员仪表盘 - 运动健康管理系统{%
endblock %} {% block content %}
<div class="container py-5">
  <h1 class="mb-4"><i class="bi bi-speedometer2"></i> 管理员仪表盘</h1>

  <!-- 显示闪现消息 -->
  {% with messages = get_flashed_messages() %} {% if messages %} {% for message
  in messages %}
  <div class="alert alert-info alert-dismissible fade show" role="alert">
    {{ message }}
    <button
      type="button"
      class="btn-close"
      data-bs-dismiss="alert"
      aria-label="Close"></button>
  </div>
  {% endfor %} {% endif %} {% endwith %}

  <!-- 添加系统概览信息 -->
  <div class="row mb-4">
    <div class="col-md-4">
      <div class="card bg-primary text-white">
        <div class="card-body">
          <h5 class="card-title"><i class="bi bi-people"></i> 用户总数</h5>
          <h2>{{ user_count }}</h2>
        </div>
      </div>
    </div>
    <div class="col-md-4">
      <div class="card bg-success text-white">
        <div class="card-body">
          <h5 class="card-title"><i class="bi bi-file-text"></i> 帖子总数</h5>
          <h2>{{ post_count }}</h2>
        </div>
      </div>
    </div>
    <div class="col-md-4">
      <div class="card bg-info text-white">
        <div class="card-body">
          <h5 class="card-title"><i class="bi bi-book"></i> 健康知识文章</h5>
          <h2>{{ article_count }}</h2>
        </div>
      </div>
    </div>
  </div>

  <div class="row mt-4">
    <div class="col-md-4 mb-4">
      <div class="card h-100 shadow-sm">
        <div class="card-body text-center">
          <i class="bi bi-people-fill fs-1 text-primary mb-3"></i>
          <h5 class="card-title">用户管理</h5>
          <p class="card-text">管理系统用户，重置密码和删除普通用户</p>
          <a href="{{ url_for('admin_users') }}" class="btn btn-primary"
            >进入</a
          >
        </div>
      </div>
    </div>

    <div class="col-md-4 mb-4">
      <div class="card h-100 shadow-sm">
        <div class="card-body text-center">
          <i class="bi bi-file-earmark-text fs-1 text-success mb-3"></i>
          <h5 class="card-title">帖子管理</h5>
          <p class="card-text">管理社区帖子，删除不适内容</p>
          <a href="{{ url_for('admin_posts') }}" class="btn btn-success"
            >进入</a
          >
        </div>
      </div>
    </div>

    <div class="col-md-4 mb-4">
      <div class="card h-100 shadow-sm">
        <div class="card-body text-center">
          <i class="bi bi-journal-text fs-1 text-warning mb-3"></i>
          <h5 class="card-title">健康知识管理</h5>
          <p class="card-text">管理健康知识文章</p>
          <a href="{{ url_for('admin_knowledge') }}" class="btn btn-warning"
            >进入</a
          >
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}
